home *** CD-ROM | disk | FTP | other *** search
/ Best of www.BestZips.com (Collector's Edition) / Best of WWW.BESTZIPS.COM Collector's Edition (JCSM Shareware) (JCS Marketing).ISO / prgtools / prtsut53.zip / SU1SRC.ZIP / REPDEM01.PAS < prev    next >
Pascal/Delphi Source File  |  1996-12-01  |  2KB  |  72 lines

  1. unit Repdem01;
  2.  
  3. interface
  4.  
  5. uses
  6.   SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  7.   StdCtrls, Forms, DBCtrls, DB, DBGrids, Buttons, DBTables, Grids,
  8.   ExtCtrls, Printers,  PrnGridR, CB_Types, CB_MFunc;
  9.  
  10. type
  11.   Tdem01form = class(TForm)
  12.     DBGrid1: TDBGrid;
  13.     Panel1: TPanel;
  14.     DataSource1: TDataSource;
  15.     Panel2: TPanel;
  16.     Table1: TTable;
  17.     Table1CustNo: TFloatField;
  18.     Table1Company: TStringField;
  19.     Table1City: TStringField;
  20.     Table1Country: TStringField;
  21.     Table1Phone: TStringField;
  22.     Label1: TLabel;
  23.     Label2: TLabel;
  24.     Label3: TLabel;
  25.     PreView: TBitBtn;
  26.     Exit: TBitBtn;
  27.     Print: TBitBtn;
  28.     PrintGridReport1: TPrintGridReport;
  29.     procedure FormCreate(Sender: TObject);
  30.     procedure PreViewClick(Sender: TObject);
  31.     procedure ExitClick(Sender: TObject);
  32.     procedure PrintClick(Sender: TObject);
  33.   private
  34.     { private declarations }
  35.   public
  36.   end;
  37.  
  38. var
  39.   dem01form: Tdem01form;
  40.  
  41. implementation
  42.  
  43. {$R *.DFM}
  44.  
  45. procedure Tdem01form.FormCreate(Sender: TObject);
  46. begin
  47.   Table1.Open;
  48.   PrintGridReport1.Orientation := Portrait;
  49. end;
  50.  
  51.  
  52. procedure Tdem01form.PreViewClick(Sender: TObject);
  53. begin
  54.      PrintGridReport1.OutputTo := poViewer;
  55.    PrintGridReport1.Execute;
  56. end;
  57.  
  58.  
  59. procedure Tdem01form.ExitClick(Sender: TObject);
  60. begin
  61.    Close;
  62. end;
  63.  
  64.  
  65. procedure Tdem01form.PrintClick(Sender: TObject);
  66. begin
  67.      PrintGridReport1.OutputTo := poPrinter;
  68.    PrintGridReport1.Execute;
  69. end;
  70.  
  71. end.
  72.